package com.diy.sigmund.diycommon.spring.extensionpoint;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * spring boot 启动扩展点
 *
 * @author ylm-sigmund
 * @since 2022/9/16 11:00
 */
public class CustomApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {

    private static final Logger log = LoggerFactory.getLogger(CustomApplicationContextInitializer.class);

    /**
     * @see SpringApplication#applyInitializers(org.springframework.context.ConfigurableApplicationContext)
     */
    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
        log.info("CustomApplicationContextInitializer initialize");
        log.info("applicationContext = " + applicationContext);
    }
}
